package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserInfoCount;
import com.culturalCenter.dataCenter.mapper.user.UserInfoCountMapper;
import com.culturalCenter.dataCenter.service.user.UserInfoCountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserInfoCount业务层接口实现类
 * @Date
 *****/
@Service
public class UserInfoCountServiceImpl implements UserInfoCountService {

    @Resource
    private UserInfoCountMapper userInfoCountMapper;

    @Override
    public PageInfo<UserInfoCount> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userInfoCountMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userInfoCountMapper.deleteById(id);
    }

    @Override
    public Integer update(UserInfoCount userInfoCount) {
        return userInfoCountMapper.update(userInfoCount);
    }

    @Override
    public Integer add(UserInfoCount userInfoCount) {
        return userInfoCountMapper.insert(userInfoCount);
    }

    @Override
    public UserInfoCount findById(String id) {
        return userInfoCountMapper.queryById(id);
    }

    @Override
    public List<UserInfoCount> findAll(UserInfoCount userInfoCount) {
        return (List<UserInfoCount>) userInfoCountMapper.queryAll(userInfoCount);
    }

}
